﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Adaptive.Mail
{
    /// <summary>
    /// Marks a method as message sending method.
    /// </summary>
    [AttributeUsage(AttributeTargets.Method, AllowMultiple=false)]
    public class SendAttribute : Attribute
    {
        /// <summary>
        /// Email of sender. Can include method parameters using string.Format syntax.
        /// </summary>
        public string From { get; set; }

        /// <summary>
        /// Recipients of mail. Can include method parameters using string.Format syntax.
        /// </summary>
        public string To { get; set; }

        /// <summary>
        /// Mail subject. Can include method parameters using string.Format syntax.
        /// </summary>
        public string Subject { get; set; }

        /// <summary>
        /// Mail body. Can include method parameters using string.Format syntax.
        /// </summary>
        public string Body { get; set; }

        /// <summary>
        /// Marks a method as message sending method.
        /// </summary>
        public SendAttribute()
        {
        }

        /// <summary>
        /// Marks a method as message sending method.
        /// </summary>
        /// <param name="from">From address, can include parameters via tags like '{0}'.</param>
        /// <param name="to">Recipients, can include parameters via tags like '{0}'.</param>
        /// <param name="subject">Mail subject, can include parameters via tags like '{0}'.</param>
        /// <param name="body">Mail body, can include parameters via tags like '{0}'.</param>
        public SendAttribute(string from, string to, string subject, string body)
        {
            From = from;
            To = to;
            Subject = subject;
            Body = body;
        }
    }
}
